import request from 'umi-request';

export async function getLeaveList(params) {
  return request('/hr-ssc/api/api-admin/leave/getLeaveList', {
    method: 'post',
    data:{
      pageNum: params.current,
      pageSize: params.pageSize,
      name:params.name,
      orgName:params.orgname,
      unitName:params.unitname,
      jobName:params.jobname,
      type:params.type
    },
  }).then((res) => {
    if (res.flag) {
      const data = res.data;
      return {
        current: data.currPage,
        data: data.list,
        pageSize: data.pageSize,
        success: true,
        total: data.totalCount,
      };
    } else {
      return {};
    }
  });
}
